// <debug>
Ext.Loader.setPath({
			'Ext' : 'sdk/src'
		});
// </debug>

Ext.application({
    models: ["User"],

	name : 'mid-demo',

	requires : ['Ext.MessageBox'],

	views : ['Main'],

	icon : {
		57 : 'resources/icons/Icon.png',
		72 : 'resources/icons/Icon~ipad.png',
		114 : 'resources/icons/Icon@2x.png',
		144 : 'resources/icons/Icon~ipad@2x.png'
	},

	phoneStartupScreen : 'resources/loading/Homescreen.jpg',
	tabletStartupScreen : 'resources/loading/Homescreen~ipad.jpg',

	launch : function() {
		// Destroy the #appLoadingIndicator element
		Ext.fly('appLoadingIndicator').destroy();

		var panel = Ext.create('Ext.Panel', {
					layout : 'card',
					items : [{
								html : "First Item"
							}, {
								html : "Second Item"
							}, {
								html : "Third Item"
							}, {
								html : "Fourth Item"
							}]
				});

		panel.setActiveItem(3);
		// Initialize the main view
		//Ext.Viewport.add(Ext.create('mid-demo.view.Main'));
		Ext.Viewport.add(panel);

	},

	onUpdated : function() {
		Ext.Msg
				.confirm(
						"Application Update",
						"This application has just successfully been updated to the latest version. Reload now?",
						function() {
							window.location.reload();
						});
	}
});
